<template>
	<view style="width: 100%;overflow-x: hidden;padding-bottom: 100rpx;">
		<tab-bar :select="0" ></tab-bar>
		<view class="top_bgc">

		</view>
		<view class="title_">
			<view class="name_">
				<view class="name_top">
					渠道商
				</view>
				<view class="name_btm">
					{{user_list.distributorName}}
				</view>
			</view>
			<view class="name_">
				<view class="name_top">
					维保单位
				</view>
				<view class="name_btm">
					{{user_list.deptName}}
				</view>
			</view>


		</view>
		<view class="bg_img">
			<view class="bg_img_i" @tap="jump(1)">
				<text>建筑列表</text>
				<image src="../../static/index/index_1.png" mode=""></image>
			</view>
			<view class="bg_img_i" @tap="jump(2)">
				<text>巡检员列表</text>
				<image src="../../static/index/index.png" mode=""></image>
			</view>
		</view>
	</view>

</template>
<script>
	export default {
		data() {
			return {
				user_list: {}
			}
		},
	
		onLoad() {
			//获取维保单位名称和渠道商
			this.getuser_list()
		},
		methods: {
			//获取维保单位信息
			getuser_list() {
				this.$https.get('getMaintainUserInfo/', {
					Authorization: uni.getStorageSync("token")
				}).then(res => {
					console.log(res, 'res');
					if (res.code == 401) {
						uni.showToast({
							title: '登录信息过期',
							icon: 'error'
						})
						setTimeout(() => {
							uni.navigateTo({
								url: '../login/login'
							})
						}, 1500)
					} else {
						this.user_list = res.user
						console.log(this.user_list, 'this.user_list');
					}
				})
			},
			//跳转不同的列表
			jump(i) {
				switch (i) {
					case 1:
						uni.navigateTo({
							url: '../build_list/build_list?deptId=' + this.user_list.deptId
						})
						break;
					case 2:
						uni.navigateTo({
							url: '../IPQC_list/IPQC_list?deptId=' + this.user_list.deptId
						})
						break;

				}
			}
		}
	}
</script>
<style lang="scss" scoped>
	.bg_img_i {
		margin-bottom: 30rpx;
		position: relative;
		display: flex;
		justify-content: center;
		align-items: center;
		font-size: 32rpx;

		text {
			width: 166rpx;
			height: 44rpx;
			line-height: 44rpx;
			position: absolute;
			// left: 50%;
			// top: 50%;
			// margin-top: -22rpx;
			// margin-left: -83rpx;
			color: #FFFFFF;
			z-index: 9999;
		}
	}

	.bg_img {
		position: absolute;
		top: 400rpx;
		left: 50%;
		margin-left: -345rpx;
height: 1000rpx;
		image {
			width: 690rpx;
			height: 386rpx;
			border-radius: 20rpx;
			overflow-x: hidden;
		}
	}

	.title_ {
		position: absolute;
		top: 70rpx;
		left: 30rpx;
	}

	.name_ {
		z-index: 999999;
		margin-bottom: 40rpx;
	}

	.name_top {
		font-size: 28rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #A9B4FF;
		margin-bottom: 14rpx;
	}

	.name_btm {
		font-size: 32rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #FFFFFF;
	}

	.top_bgc {
		box-shadow: 0px 12rpx 20rpx 0px rgba(181, 190, 255, 1);
		background-color: #4053CD;
		width: 750rpx;
		height: 500rpx;
	}

	// .top_bgc {
	// 	box-shadow: 0px 12rpx 20rpx 0px rgba(181, 190, 255, 1);
	// 	content: '';
	// 	width: 2500rpx;
	// 	height: 2580rpx;
	// 	border-radius: 1250rpx;
	// 	position: absolute;
	// 	top: -2070rpx;
	// 	left: 50%;
	// 	z-index: -1;
	// 	margin-left: -1250rpx;
	// 	background-color: #4053CD;

	// }
</style>
